/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.googlecode.jsimplemarket.model;

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Alexandru.Codescu
 */
@Entity
@Table(name = "taxe")
@NamedQueries({
	@NamedQuery(
            name = "Taxa.queryTaxePlataRapida",
            query = "select tax from Taxa tax "
            + "join tax.tipTaxa tipTax "
            + "where tipTax.incasareRapida = true"),
    @NamedQuery(
            name = "Taxa.queryTaxePlataRapida25",
            query = "select tax from Taxa tax "
            + "join tax.tipTaxa tipTax "
            + "where tipTax.incasareRapida = true" +
            " and tax.id = 1"),      
    @NamedQuery(
            name = "Taxa.queryTaxePlataRapida015",
            query = "select tax from Taxa tax "
            + "join tax.tipTaxa tipTax "
            + "where tipTax.incasareRapida = true" +
            " and tax.id <> 1")     

})            
public class Taxa extends AbstractNomenclator {
    private NTipTaxa tipTaxa;
    private BigDecimal discount;
    private BigDecimal valoare;
    private String cssClass;
    private String denumireStare;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "ID_TIP_TAXA")
    public NTipTaxa getTipTaxa() {
        return tipTaxa;
    }

    public void setTipTaxa(NTipTaxa tipTaxa) {
        this.tipTaxa = tipTaxa;
    }

    @Column(name = "DISCOUNT")
    public BigDecimal getDiscount() {
        return discount;
    }

    public void setDiscount(BigDecimal discount) {
        this.discount = discount;
    }

    @Column(name = "VALOARE")
    public BigDecimal getValoare() {
        return valoare;
    }

    public void setValoare(BigDecimal valoare) {
        this.valoare = valoare;
    }
    
    @Column(name = "CSS_CLASS")
	public String getCssClass() {
		return cssClass;
	}

	public void setCssClass(String cssClass) {
		this.cssClass = cssClass;
	}
	
	@Column(name = "DENUMIRE_STARE")
	public String getDenumireStare() {
		return denumireStare;
	}

	public void setDenumireStare(String denumireStare) {
		this.denumireStare = denumireStare;
	}
}
